//获取应用实例
const app = getApp();
// 引入AES.js
var baseJs = require("../../common/base.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imgUrl: baseJs.imgUrl,
    pageIndex: 1,
    listData: [],
    state: '',
    // 
    agentId:"1120",
    

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      // agentId: options.agentId
    })
    this.AgentBigExperienceGetHeHuoRenGoodsApply();
  },

  // 
  AgentBigExperienceGetHeHuoRenGoodsApply: function () {
    var that = this;
    var uid = this.data.uid;
    var pageIndex = this.data.pageIndex;
    var listData = this.data.listData;
    var agentId = this.data.agentId;
    if (pageIndex == 1) {
      wx.showLoading({
        title: '加载中',
      })
    }
    wx.request({
      url: baseJs.api + baseJs.encryUrl("method=AgentBigExperienceGetHeHuoRenGoodsApply&UID=" + agentId),
      success: function (res) {
        console.log(JSON.parse(baseJs.decryUrl(res.data)));
        listData = JSON.parse(baseJs.decryUrl(res.data)).ResultData;
        for (var i = 0; i < listData.length; i++) {
          listData[i].WaitDealApplyMa = parseFloat(listData[i].WaitDealApplyMa).toFixed(2);
          listData[i].AllBorrowMa = parseFloat(listData[i].AllBorrowMa).toFixed(2);
          listData[i].AllReturnMa = parseFloat(listData[i].AllReturnMa).toFixed(2);
        }
        that.setData({
          listData: listData,
        })
        wx.hideLoading();
      }
    })
  },
 
  // 

})